<script>
export default {
  name: "SchoolComponents",
  data() {
    return {
      schoolName: '尚硅谷',
      address: '北京昌平'
    }
  },
  methods: {
    showName() {
      alert(this.schoolName);
    }
  }
}
</script>

<template>
  <div class="demo">
    <h2>学校名称: {{schoolName}}</h2>
    <h2>学校地址: {{address}}</h2>
    <button @click="showName">点击显示学校名</button>
  </div>
</template>

<style scoped>

</style>